import request from '@/utils/request'

export function getAllArticle(query,click) {
  return request({
    url: 'webArticle/getAllArticle/' + query.page + '/' + query.limit + '/' + click,
    method: 'get'
  })
}

export function getArticleById(id) {
  return request({
    url: 'webArticle/getArticleById/' + id,
    method: 'get'
  })
}

export function getNewArticle(num,click) {
  return request({
    url: 'webArticle/getNewArticle/' + num + '/' + click,
    method: 'get'
  })
}

export function getAllArticleNumber() {
  return request({
    url: 'webArticle/getAllArticleNumber/',
    method: 'get'
  })
}

export function FindArticles(title) {
  return request({
    url: 'webArticle/findArticles/'+ title,
    method: 'get'
  })
}

export function FindArticlesByNum(title,num) {
  return request({
    url: 'webArticle/findArticlesByNum/'+ title +"/" + num,
    method: 'get'
  })
}

export function FindAllArticle(query) {
  return request({
    url: 'webArticle/findAllArticle/'+query.content + '/' + query.page + '/' + query.limit,
    method: 'get'
  })
}

export function FindProfileByName(name) {
  return request({
    url: '/webArticle/findProfileByName/'+name,
    method: 'get'
  })
}

export function viewarticle(id) {
  return request({
    url: '/webArticle/articles/'+ id +'/view',
    method: 'get',
  })
}

export function lovearticle(id) {
  return request({
    url: '/webArticle/articles/'+ id +'/love',
    method: 'get',
  })
}

export function getArticleMatter() {
  return request({
    url: '/webArticle/getArticleMatter',
    method: 'get',
  })
}

export function getPreArticle(id) {
  return request({
    url: '/webArticle/getPreArticle/' + id,
    method: 'get',
  })
}

export function getLastArticle(id) {
  return request({
    url: '/webArticle/getLastArticle/' + id,
    method: 'get',
  })
}
